home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / widget / nsITransferable.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  16KB  |  373 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsITransferable.idl
  3.  */
  4.  
  5. #ifndef __gen_nsITransferable_h__
  6. #define __gen_nsITransferable_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsISupportsArray_h__
  14. #include "nsISupportsArray.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIFormatConverter_h__
  18. #include "nsIFormatConverter.h"
  19. #endif
  20.  
  21. /* For IDL files that don't want to include root IDL files. */
  22. #ifndef NS_NO_VTABLE
  23. #define NS_NO_VTABLE
  24. #endif
  25. // these probably shouldn't live here, but in some central repository shared
  26. // by the entire app.
  27. #define kTextMime                   "text/plain"
  28. #define kUnicodeMime                "text/unicode"
  29. #define kHTMLMime                   "text/html"
  30. #define kAOLMailMime                "AOLMAIL"
  31. #define kPNGImageMime               "image/png"
  32. #define kJPEGImageMime              "image/jpg"
  33. #define kGIFImageMime               "image/gif"
  34. #define kFileMime                   "application/x-moz-file"
  35. #define kURLMime                    "text/x-moz-url"        // data contains url\ntitle
  36. #define kURLDataMime                "text/x-moz-url-data"   // data contains url only
  37. #define kURLDescriptionMime         "text/x-moz-url-desc"   // data contains description
  38. #define kNativeImageMime            "application/x-moz-nativeimage"
  39. #define kNativeHTMLMime             "application/x-moz-nativehtml"
  40. // the source URL for a file promise
  41. #define kFilePromiseURLMime         "application/x-moz-file-promise-url"
  42. // the destination filename for a file promise
  43. #define kFilePromiseDestFilename    "application/x-moz-file-promise-dest-filename"
  44. // a dataless flavor used to interact with the OS during file drags
  45. #define kFilePromiseMime            "application/x-moz-file-promise"
  46. // a synthetic flavor, put into the transferable once we know the destination directory of a file drag
  47. #define kFilePromiseDirectoryMime   "application/x-moz-file-promise-dir"
  48. class nsITransferable; /* forward declaration */
  49.  
  50.  
  51. /* starting interface:    nsIFlavorDataProvider */
  52. #define NS_IFLAVORDATAPROVIDER_IID_STR "7e225e5f-711c-11d7-9fae-000393636592"
  53.  
  54. #define NS_IFLAVORDATAPROVIDER_IID \
  55.   {0x7e225e5f, 0x711c, 0x11d7, \
  56.     { 0x9f, 0xae, 0x00, 0x03, 0x93, 0x63, 0x65, 0x92 }}
  57.  
  58. class NS_NO_VTABLE nsIFlavorDataProvider : public nsISupports {
  59.  public: 
  60.  
  61.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFLAVORDATAPROVIDER_IID)
  62.  
  63.   /**
  64.     * Retrieve the data from this data provider.
  65.     *
  66.     * @param  aTransferable (in parameter) the transferable we're being called for.
  67.     * @param  aFlavor (in parameter) the flavor of data to retrieve
  68.     * @param  aData the data. Some variant of class in nsISupportsPrimitives.idl
  69.     * @param  aDataLen the length of the data
  70.     */
  71.   /* void getFlavorData (in nsITransferable aTransferable, in string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  72.   NS_IMETHOD GetFlavorData(nsITransferable *aTransferable, const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) = 0;
  73.  
  74. };
  75.  
  76. /* Use this macro when declaring classes that implement this interface. */
  77. #define NS_DECL_NSIFLAVORDATAPROVIDER \
  78.   NS_IMETHOD GetFlavorData(nsITransferable *aTransferable, const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen); 
  79.  
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  81. #define NS_FORWARD_NSIFLAVORDATAPROVIDER(_to) \
  82.   NS_IMETHOD GetFlavorData(nsITransferable *aTransferable, const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return _to GetFlavorData(aTransferable, aFlavor, aData, aDataLen); } 
  83.  
  84. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  85. #define NS_FORWARD_SAFE_NSIFLAVORDATAPROVIDER(_to) \
  86.   NS_IMETHOD GetFlavorData(nsITransferable *aTransferable, const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlavorData(aTransferable, aFlavor, aData, aDataLen); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsFlavorDataProvider : public nsIFlavorDataProvider
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSIFLAVORDATAPROVIDER
  97.  
  98.   nsFlavorDataProvider();
  99.  
  100. private:
  101.   ~nsFlavorDataProvider();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsFlavorDataProvider, nsIFlavorDataProvider)
  109.  
  110. nsFlavorDataProvider::nsFlavorDataProvider()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsFlavorDataProvider::~nsFlavorDataProvider()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* void getFlavorData (in nsITransferable aTransferable, in string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  121. NS_IMETHODIMP nsFlavorDataProvider::GetFlavorData(nsITransferable *aTransferable, const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125.  
  126. /* End of implementation class template. */
  127. #endif
  128.  
  129.  
  130. /* starting interface:    nsITransferable */
  131. #define NS_ITRANSFERABLE_IID_STR "8b5314bc-db01-11d2-96ce-0060b0fb9956"
  132.  
  133. #define NS_ITRANSFERABLE_IID \
  134.   {0x8b5314bc, 0xdb01, 0x11d2, \
  135.     { 0x96, 0xce, 0x00, 0x60, 0xb0, 0xfb, 0x99, 0x56 }}
  136.  
  137. /**
  138.   * nsIFlavorDataProvider allows a flavor to 'promise' data later,
  139.   * supplying the data lazily.
  140.   * 
  141.   * To use it, call setTransferData, passing the flavor string,
  142.   * a nsIFlavorDataProvider QI'd to nsISupports, and a data size of 0.
  143.   *
  144.   * When someone calls getTransferData later, if the data size is
  145.   * stored as 0, the nsISupports will be QI'd to nsIFlavorDataProvider,
  146.   * and its getFlavorData called.
  147.   *
  148.   */
  149. class NS_NO_VTABLE nsITransferable : public nsISupports {
  150.  public: 
  151.  
  152.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITRANSFERABLE_IID)
  153.  
  154.   enum { kFlavorHasDataProvider = 0 };
  155.  
  156.   /**
  157.     * Computes a list of flavors (mime types as nsISupportsCString) that the transferable 
  158.     * can export, either through intrinsic knowledge or output data converters.
  159.     *
  160.     * @param  aDataFlavorList fills list with supported flavors. This is a copy of
  161.     *          the internal list, so it may be edited w/out affecting the transferable.
  162.     */
  163.   /* nsISupportsArray flavorsTransferableCanExport (); */
  164.   NS_IMETHOD FlavorsTransferableCanExport(nsISupportsArray **_retval) = 0;
  165.  
  166.   /**
  167.     * Given a flavor retrieve the data. 
  168.     *
  169.     * @param  aFlavor (in parameter) the flavor of data to retrieve
  170.     * @param  aData the data. Some variant of class in nsISupportsPrimitives.idl
  171.     * @param  aDataLen the length of the data
  172.     */
  173.   /* void getTransferData (in string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  174.   NS_IMETHOD GetTransferData(const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) = 0;
  175.  
  176.   /**
  177.     * Returns the best flavor in the transferable, given those that have
  178.     * been added to it with |AddFlavor()|
  179.     *
  180.     * @param  aFlavor (out parameter) the flavor of data that was retrieved
  181.     * @param  aData the data. Some variant of class in nsISupportsPrimitives.idl
  182.     * @param  aDataLen the length of the data
  183.     */
  184.   /* void getAnyTransferData (out string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  185.   NS_IMETHOD GetAnyTransferData(char **aFlavor, nsISupports **aData, PRUint32 *aDataLen) = 0;
  186.  
  187.   /**
  188.     * Returns true if the data is large.
  189.     */
  190.   /* boolean isLargeDataSet (); */
  191.   NS_IMETHOD IsLargeDataSet(PRBool *_retval) = 0;
  192.  
  193.   /**
  194.     * Computes a list of flavors (mime types as nsISupportsCString) that the transferable can
  195.     * accept into it, either through intrinsic knowledge or input data converters.
  196.     *
  197.     * @param  outFlavorList fills list with supported flavors. This is a copy of
  198.     *          the internal list, so it may be edited w/out affecting the transferable.
  199.     */
  200.   /* nsISupportsArray flavorsTransferableCanImport (); */
  201.   NS_IMETHOD FlavorsTransferableCanImport(nsISupportsArray **_retval) = 0;
  202.  
  203.   /**
  204.     * Sets the data in the transferable with the specified flavor. The transferable
  205.     * will maintain its own copy the data, so it is not necessary to do that beforehand.
  206.     *
  207.     * @param  aFlavor the flavor of data that is being set
  208.     * @param  aData the data, some variant of class in nsISupportsPrimitives.idl,
  209.     *         or an nsIFlavorDataProvider (see above)
  210.     * @param  aDataLen the length of the data, or 0 if passing a nsIFlavorDataProvider
  211.     */
  212.   /* void setTransferData (in string aFlavor, in nsISupports aData, in unsigned long aDataLen); */
  213.   NS_IMETHOD SetTransferData(const char *aFlavor, nsISupports *aData, PRUint32 aDataLen) = 0;
  214.  
  215.   /**
  216.     * Add the data flavor, indicating that this transferable 
  217.     * can receive this type of flavor
  218.     *
  219.     * @param  aDataFlavor a new data flavor to handle
  220.     */
  221.   /* void addDataFlavor (in string aDataFlavor); */
  222.   NS_IMETHOD AddDataFlavor(const char *aDataFlavor) = 0;
  223.  
  224.   /**
  225.     * Removes the data flavor matching the given one (string compare) and the data
  226.     * that goes along with it.
  227.     *
  228.     * @param  aDataFlavor a data flavor to remove
  229.     */
  230.   /* void removeDataFlavor (in string aDataFlavor); */
  231.   NS_IMETHOD RemoveDataFlavor(const char *aDataFlavor) = 0;
  232.  
  233.   /* attribute nsIFormatConverter converter; */
  234.   NS_IMETHOD GetConverter(nsIFormatConverter * *aConverter) = 0;
  235.   NS_IMETHOD SetConverter(nsIFormatConverter * aConverter) = 0;
  236.  
  237. };
  238.  
  239. /* Use this macro when declaring classes that implement this interface. */
  240. #define NS_DECL_NSITRANSFERABLE \
  241.   NS_IMETHOD FlavorsTransferableCanExport(nsISupportsArray **_retval); \
  242.   NS_IMETHOD GetTransferData(const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen); \
  243.   NS_IMETHOD GetAnyTransferData(char **aFlavor, nsISupports **aData, PRUint32 *aDataLen); \
  244.   NS_IMETHOD IsLargeDataSet(PRBool *_retval); \
  245.   NS_IMETHOD FlavorsTransferableCanImport(nsISupportsArray **_retval); \
  246.   NS_IMETHOD SetTransferData(const char *aFlavor, nsISupports *aData, PRUint32 aDataLen); \
  247.   NS_IMETHOD AddDataFlavor(const char *aDataFlavor); \
  248.   NS_IMETHOD RemoveDataFlavor(const char *aDataFlavor); \
  249.   NS_IMETHOD GetConverter(nsIFormatConverter * *aConverter); \
  250.   NS_IMETHOD SetConverter(nsIFormatConverter * aConverter); 
  251.  
  252. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  253. #define NS_FORWARD_NSITRANSFERABLE(_to) \
  254.   NS_IMETHOD FlavorsTransferableCanExport(nsISupportsArray **_retval) { return _to FlavorsTransferableCanExport(_retval); } \
  255.   NS_IMETHOD GetTransferData(const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return _to GetTransferData(aFlavor, aData, aDataLen); } \
  256.   NS_IMETHOD GetAnyTransferData(char **aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return _to GetAnyTransferData(aFlavor, aData, aDataLen); } \
  257.   NS_IMETHOD IsLargeDataSet(PRBool *_retval) { return _to IsLargeDataSet(_retval); } \
  258.   NS_IMETHOD FlavorsTransferableCanImport(nsISupportsArray **_retval) { return _to FlavorsTransferableCanImport(_retval); } \
  259.   NS_IMETHOD SetTransferData(const char *aFlavor, nsISupports *aData, PRUint32 aDataLen) { return _to SetTransferData(aFlavor, aData, aDataLen); } \
  260.   NS_IMETHOD AddDataFlavor(const char *aDataFlavor) { return _to AddDataFlavor(aDataFlavor); } \
  261.   NS_IMETHOD RemoveDataFlavor(const char *aDataFlavor) { return _to RemoveDataFlavor(aDataFlavor); } \
  262.   NS_IMETHOD GetConverter(nsIFormatConverter * *aConverter) { return _to GetConverter(aConverter); } \
  263.   NS_IMETHOD SetConverter(nsIFormatConverter * aConverter) { return _to SetConverter(aConverter); } 
  264.  
  265. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  266. #define NS_FORWARD_SAFE_NSITRANSFERABLE(_to) \
  267.   NS_IMETHOD FlavorsTransferableCanExport(nsISupportsArray **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FlavorsTransferableCanExport(_retval); } \
  268.   NS_IMETHOD GetTransferData(const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTransferData(aFlavor, aData, aDataLen); } \
  269.   NS_IMETHOD GetAnyTransferData(char **aFlavor, nsISupports **aData, PRUint32 *aDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnyTransferData(aFlavor, aData, aDataLen); } \
  270.   NS_IMETHOD IsLargeDataSet(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsLargeDataSet(_retval); } \
  271.   NS_IMETHOD FlavorsTransferableCanImport(nsISupportsArray **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FlavorsTransferableCanImport(_retval); } \
  272.   NS_IMETHOD SetTransferData(const char *aFlavor, nsISupports *aData, PRUint32 aDataLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTransferData(aFlavor, aData, aDataLen); } \
  273.   NS_IMETHOD AddDataFlavor(const char *aDataFlavor) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDataFlavor(aDataFlavor); } \
  274.   NS_IMETHOD RemoveDataFlavor(const char *aDataFlavor) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDataFlavor(aDataFlavor); } \
  275.   NS_IMETHOD GetConverter(nsIFormatConverter * *aConverter) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetConverter(aConverter); } \
  276.   NS_IMETHOD SetConverter(nsIFormatConverter * aConverter) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetConverter(aConverter); } 
  277.  
  278. #if 0
  279. /* Use the code below as a template for the implementation class for this interface. */
  280.  
  281. /* Header file */
  282. class nsTransferable : public nsITransferable
  283. {
  284. public:
  285.   NS_DECL_ISUPPORTS
  286.   NS_DECL_NSITRANSFERABLE
  287.  
  288.   nsTransferable();
  289.  
  290. private:
  291.   ~nsTransferable();
  292.  
  293. protected:
  294.   /* additional members */
  295. };
  296.  
  297. /* Implementation file */
  298. NS_IMPL_ISUPPORTS1(nsTransferable, nsITransferable)
  299.  
  300. nsTransferable::nsTransferable()
  301. {
  302.   /* member initializers and constructor code */
  303. }
  304.  
  305. nsTransferable::~nsTransferable()
  306. {
  307.   /* destructor code */
  308. }
  309.  
  310. /* nsISupportsArray flavorsTransferableCanExport (); */
  311. NS_IMETHODIMP nsTransferable::FlavorsTransferableCanExport(nsISupportsArray **_retval)
  312. {
  313.     return NS_ERROR_NOT_IMPLEMENTED;
  314. }
  315.  
  316. /* void getTransferData (in string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  317. NS_IMETHODIMP nsTransferable::GetTransferData(const char *aFlavor, nsISupports **aData, PRUint32 *aDataLen)
  318. {
  319.     return NS_ERROR_NOT_IMPLEMENTED;
  320. }
  321.  
  322. /* void getAnyTransferData (out string aFlavor, out nsISupports aData, out unsigned long aDataLen); */
  323. NS_IMETHODIMP nsTransferable::GetAnyTransferData(char **aFlavor, nsISupports **aData, PRUint32 *aDataLen)
  324. {
  325.     return NS_ERROR_NOT_IMPLEMENTED;
  326. }
  327.  
  328. /* boolean isLargeDataSet (); */
  329. NS_IMETHODIMP nsTransferable::IsLargeDataSet(PRBool *_retval)
  330. {
  331.     return NS_ERROR_NOT_IMPLEMENTED;
  332. }
  333.  
  334. /* nsISupportsArray flavorsTransferableCanImport (); */
  335. NS_IMETHODIMP nsTransferable::FlavorsTransferableCanImport(nsISupportsArray **_retval)
  336. {
  337.     return NS_ERROR_NOT_IMPLEMENTED;
  338. }
  339.  
  340. /* void setTransferData (in string aFlavor, in nsISupports aData, in unsigned long aDataLen); */
  341. NS_IMETHODIMP nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, PRUint32 aDataLen)
  342. {
  343.     return NS_ERROR_NOT_IMPLEMENTED;
  344. }
  345.  
  346. /* void addDataFlavor (in string aDataFlavor); */
  347. NS_IMETHODIMP nsTransferable::AddDataFlavor(const char *aDataFlavor)
  348. {
  349.     return NS_ERROR_NOT_IMPLEMENTED;
  350. }
  351.  
  352. /* void removeDataFlavor (in string aDataFlavor); */
  353. NS_IMETHODIMP nsTransferable::RemoveDataFlavor(const char *aDataFlavor)
  354. {
  355.     return NS_ERROR_NOT_IMPLEMENTED;
  356. }
  357.  
  358. /* attribute nsIFormatConverter converter; */
  359. NS_IMETHODIMP nsTransferable::GetConverter(nsIFormatConverter * *aConverter)
  360. {
  361.     return NS_ERROR_NOT_IMPLEMENTED;
  362. }
  363. NS_IMETHODIMP nsTransferable::SetConverter(nsIFormatConverter * aConverter)
  364. {
  365.     return NS_ERROR_NOT_IMPLEMENTED;
  366. }
  367.  
  368. /* End of implementation class template. */
  369. #endif
  370.  
  371.  
  372. #endif /* __gen_nsITransferable_h__ */
  373.